DIR1:=netlib
DIR2:=threadpool
INC_PATH:=$(DIR1) $(DIR2)
ALL_CC:=$(wildcard *.cc) $(wildcard ./netlib/*.cc) $(wildcard ./threadpool/*.cc) 
SRC_CC+=$(filter-out ./threadpool/test.cc, $(ALL_CC))  # 忽略掉指定文件
OBJS:=$(patsubst %.cc, %.o, $(SRC_CC))

CPP:=g++ -std=c++11
CFLAGS:=-g -w # -Wall 显示警告 -w 忽略警告
ELF:=server
LIBS:=-lpthread # 动态库

$(ELF):$(OBJS) # 链接 .o -> elf
	$(CPP) $(CFLAGS)  $^ -o $@ $(LIBS)
%.o:%.cc # 编译 .cc -> .o
	$(CPP) $(CFLAGS) -I $(DIR1) -I $(DIR2) -c $< -o $@ $(LIBS)

clean:
	rm -rf $(ELF) $(OBJS)
